import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
	public static String getWordSquare(int row, int col, String word, String token) {
		String result = "";
		int position;
		
		for(int i = 0; i < row; i++) {
			position = (row * (col - 1)) + i;
			for(int j = 0; j < col; j++) {
				result += word.charAt(position);
				if(j != col - 1)
					result += token;
				position -= row;
			}
			result += "\n";
		}
		return result;
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder output;
		String input;
		String word;
		String token;
		int row, col;
		
		while((input = br.readLine()) != null) {
			word = input;
			token = br.readLine();
			row = Integer.parseInt(br.readLine());
			col = word.length() / row;
			
			output = new StringBuilder(getWordSquare(row, col, word, token));
			
			System.out.print(output);
		}
	}
}